<?php

namespace app\server\notice\model;

use app\server\notice\interfaces\MsgDriver;

/**
 * 推送消息策略 短信|邮件
 *
 * Class Push
 * @package app\server\notice\model
 */
class Push
{
    private $_strategy;

    /**
     * 运行策略
     *
     * @param array $params 具体
     * @return mixed
     */
    public function run(array $params = [])
    {
        return $this->_strategy->msgSend($params);
    }

    /**
     * 策略注入
     *
     * @param MsgDriver $msgDriver
     * @return MsgDriver
     */
    public function setStrategy(MsgDriver $msgDriver)
    {
        return $this->_strategy = $msgDriver;
    }

}